<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
	var d = new Date();
	//alert(d.getDate());
	//alert(d.getHours());
	//alert(d.getDay());
	//var days = new Array("日", "一", "二", "三", "四", "五", "六");
	
	//alert(d.getFullYear() + "/" + (d.getMonth()+1) + "/" + d.getDate() + "(" + days[d.getDay()] + ")" + d.toTimeString() );

	var fin = new Date(2013, 9, 25, 8, 0);
	
	alert(fin);
	alert(d);
	
	alert(getDueString(fin, d));
	
	function getDueString(due, date) {
		alert(due);
		alert(date);
		
		var min_sec = 1000*60;
		var hour_sec = min_sec*60;
		var day_sec = hour_sec*24;
		var s = "";
				
		var diff = due.getTime() - date.getTime();
		alert(diff);
		
		var day = Math.floor(diff/day_sec);
		if (day > 0) {
			s = day + "天";
			diff -= day*day_sec;
		}
		alert(s);
		var hour = Math.floor(diff/hour_sec);
		if (hour > 0){
			s = s + hour + "小時";
			diff -= hour*hour_sec;
		}
		alert(s);
		var min = Math.floor(diff/min_sec);
		if (min > 0) {
			s = s + min + "分";
		}
		alert(s);
		return(s);
	}
</script>)
</body>
</html>